<template>
  <div>
    <el-container>
      <el-header class="header"
        >xxxxx大型后台管理系统
        <div>
          欢迎VIP用户:{{$store.getters.getUser.username}}
        </div>
        <el-button @click="logout" type="danger" size="mini" class="btn">退出登录</el-button>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <v-nav></v-nav>
        </el-aside>
        <el-main>
          <!-- 二级路由出口 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
import vNav from "../components/vNav";
export default {
  data() {
    return {};
  },
  methods: {
    logout() {
      // console.log(11);
      // 清空仓库内容
      this.$store.dispatch('changeUserInfo',false)
      // 跳转到登录
      this.$router.push('/login')
    },
  },
  mounted() {},
  watch: {},
  computed: {},
  filters: {},
  components: {
    vNav,
  },
};
</script>
<style scoped>
.header {
  height: 65px;
  background: #5f8cc6;
}

.btn{
  position: absolute;
  top:15px;
  right:10px;
}
</style>
